﻿using System.Globalization;
using System.Windows;

namespace NanoMvvm.Demo.Localization
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            NanoMvvmFramework.Initialize(Application.Current);
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if (NanoMvvmFramework.IsInitialized &&
                (NanoMvvmFramework.Instance.Localization.CurrentUiCulture.Name == "en" 
                || NanoMvvmFramework.Instance.Localization.CurrentUiCulture.Name.StartsWith("en-")))
            {
                NanoMvvmFramework.Instance.Localization.CurrentUiCulture = new CultureInfo("hr");
            }
            else
            {
                NanoMvvmFramework.Instance.Localization.CurrentUiCulture = new CultureInfo("en");
            }
        }
    }
}
